<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core">
	<h:head>
		<title>#{msgs.title_sistema} - #{msgs.title_listaFuncionario}</title>
	</h:head>
	<h:body>
		<center>
			<h1> #{msgs.title_listaFuncionario} </h1>

		</center>
		<h:form>
			<h:panelGrid columns="3" >
					<h:selectBooleanCheckbox value="#{funcionarioMBean.filtroNome }" />
					<h:outputText value="#{msgs.field_nome}"/>
					<h:inputText value="#{funcionarioMBean.filtroFuncionario.pessoa.nome }" /> 	
					
					<h:selectBooleanCheckbox value="#{funcionarioMBean.filtroCpf }" />				
					<h:outputText value="#{msgs.field_cpf}"/>
					<h:inputText value="#{funcionarioMBean.filtroFuncionario.pessoa.cpf }" /> 		
					
					<h:selectBooleanCheckbox value="#{funcionarioMBean.filtroAll }" />
					<h:outputText value="#{msgs.field_lista_todos}"/>
									
			</h:panelGrid>

			<h:commandButton value="#{msgs.button_voltar}" action="#{funcionarioMBean.actionVoltar }" />
			<h:commandButton value="#{msgs.button_buscar}" action="#{funcionarioMBean.actionBuscar }" />
		</h:form>	
			
		<h:dataTable value="#{funcionarioMBean.listEntidade}" var="lista" border="1">
			<h:column>
				<f:facet name="header">
					<h:outputText value="#{msgs.head_column_nome}" />
				</f:facet>
				<h:outputText value="#{lista.pessoa.nome}" />
				<br />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="#{msgs.head_column_cargo}" />
				</f:facet>
					<h:outputText value="#{lista.cargo.nome}" />
					<br/>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="#{msgs.head_column_rg}" />
				</f:facet>
				<h:outputText value="#{lista.pessoa.rg}" />
				<br />

			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="#{msgs.head_column_cpf}" />
				</f:facet>
					<h:outputText value="#{lista.pessoa.cpf}" />
					<br/>
			</h:column>
			<h:column>
				<h:form>
					<h:commandButton value="#{msgs.button_alterar}" action="#{funcionarioMBean.actionAlterar }" >
						<f:setPropertyActionListener target="#{funcionarioMBean.entidade}" value="#{lista}" />
					</h:commandButton>
				</h:form>
			</h:column>
			<h:column>
				<h:form>
					<h:commandButton value="#{msgs.button_remover}" action="#{funcionarioMBean.actionRemover }" >
						<f:setPropertyActionListener target="#{funcionarioMBean.entidade}" value="#{lista}" />
					</h:commandButton>
				</h:form>
			</h:column>
		</h:dataTable>
	</h:body>
</html>